LATEX provides a reasonably powerful picture drawing capability. There are many useful commands provided although the user-interface has room for improvement. The commands described in this document aim to achieve a simpler and more powerful interface.
Most picture drawing commands require explicit specification of coordinates for every object. Although explicit coordinates is the basis of the picture environment, it is possible to provide higher level commands which reduce the amount of coordinates that need to be manually calculated. There are basically two approaches that can be taken in designing such commands:
\shortstack
command falls into this category.
\multiput
command is
one example of this approach.
The obvious advantage of having commands that fall into the above categories
is that not only they are easier to specify initially, but any subsequent
modification to the layout requires minimal recalculations. For instance, to
modify the coordinates in a \multiput
statement plotting n objects
requires recalculation of at most 4 coordinates, whereas the equivalent
\put
statements may require upto 2n calculations and/or
recalculations.
Another frequently used command, \line
has severe limitations and
drawbacks. The
arguments that the \line
command expects are very non-intuitive and
requires extensive calculations — often the thought process in writing a
\line
command involves:
Above mechanism is a cumbersome way of specifying a line. It also has the
drawback that the length of the shortest line of different slopes that
can be drawn is different; for instance, assuming \unitlength=1pt
,
\line(1,6){10}
is the shortest line of the given slope that can be
drawn; it is considerably longer than the available line segment of this
slope — 60.8pt rather than about 11pt. It should be emphasized that this
is a drawback of only the implementation of the \line
command and is not an inherent limitation. This report describes a few line
drawing commands all of which overcome such a drawback, while providing a
simpler syntax. They all take, as arguments, only the coordinates of the
end-points, thus eliminating all other steps involved in specifying a
line; it also seems to be a natural way of perceiving a line in an
environment where all the work is done in terms of coordinates.
A few new commands are developed and described in this report. They provide a simpler syntax and a higher-level user-interface. Also some of the commands permit one to plot objects that were previously cumbersome or difficult to plot. All existing commands still remain accessible. With the new commands it should now be possible to make pictures with less effort and make more sophisticated pictures than was possible earlier.